until [ -n "$(kubectl get svc udp-gateway -n stunner -o jsonpath='{.status.loadBalancer.ingress[0].ip}')" ]; do sleep 1; done
export STUNNERIP=$(kubectl get service udp-gateway -n stunner -o jsonpath='{.status.loadBalancer.ingress[0].ip}')

echo $STUNNERIP

cp livekit/livekit-server.yaml .
sed -i "s/stunner_ip/$STUNNERIP/g" livekit-server.yaml

# kubectl get service -n kube-system clusternginx-ingress-controller -o jsonpath='{.status.loadBalancer.ingress[0].ip}'
# export INGRESSIP=$(kubectl get service  -n kube-system  cluster-nginx-ingress-controller -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
# export INGRESSIP=$(echo $INGRESSIP | sed 's/\./-/g')

# echo $INGRESSIP

# sed -i "s/ingressserviceip/$INGRESSIP/g" livekit/livekit-server.yaml
